package com.klikmee.sms.chat.web.dao;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

import com.klikmee.sms.services.chat.model.Agent;
import com.klikmee.sms.services.chat.model.Question;
import com.klikmee.sms.services.chat.model.QuestionResponsibility;

public class QuestionResponsabilityDAO extends AbstractDAO<QuestionResponsibility> {

	@PersistenceContext
	EntityManager entityManager;
	
	public QuestionResponsabilityDAO() {
		super(QuestionResponsibility.class);
		// TODO Auto-generated constructor stub
	}
	
	public QuestionResponsibility findByAngentAndQuestion(Agent agent, Question question) {

		return (QuestionResponsibility)entityManager.createNamedQuery("QuestionResponsibility.findByAgentAndQuestion").setParameter("agent", agent).setParameter("question", question).getSingleResult();
		
	}
	
}
